<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>  </title>
<script language="javascript" src="__ROOT__/Lib/ORG/js/Id.js"></script>
</head>

<body>

<?php
//杩炴帴鏁版嵁搴揻
$con = mysql_connect('localhost', 'root', 'root');
if(!$con){
die('Could not connect:'.mysql_error());
}
mysql_select_db("campusfair", $con);

//鎼滅储涓€绾у垎绫?
$sql = "SELECT markid, name, contain_markid FROM cp_school_v1 WHERE isschool = '1'";
$result = mysql_query($sql);
?>

<form name="myform">
<b>Please Select School Info:</b><!--涓€绾т笅鎷夋-->

<select name="school" onchange="showsecond(this.value)">

<?php
	while($row = mysql_fetch_array($result)){
?>

<option value="<?=$row['contain_markid'];?>"><?=$row['name'];?></option>

<?php
}
?>

</select>

<select id="second" style="width:200px; display:none;"></select>

</form>

<script type="text/javascript">
function CreateXHR()
{

	var request;
	//杩斿洖娴忚鍣ㄧ殑鍚嶇О
	var browser = navigator.appName;

	//浣跨敤IE锛屽垯浣跨敤XMLHttp瀵硅薄
	if(browser == "Microsoft Internet Explorer")
	{
   var arrVersions = ["Microsoft.XMLHttp", "MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0", "MSXML2.XMLHttp","MSXML2.XMLHttp.5.0"];
   for (var i=0; i < arrVersions.length; i++)
   {
	   try
	   {
	     //浠庝腑鎵惧埌涓€涓敮鎸佺殑鐗堟湰骞跺缓绔媂MLHttp瀵硅薄
	     request = new ActiveXObject(arrVersions[i]);
	     return request;
	   }
	  	catch(exception)
	  	{
	  		//蹇界暐锛岀户缁?
	  	}
   }
	}

	else
	{
   //鍚﹀垯杩斿洖涓€涓猉MLHttpRequest瀵硅薄
   request = new XMLHttpRequest();
   if(request.overrideMimeType)
   {
    request.overrideMimeType('text/xml;charset=utf-8');
   }

    return request;
	} 

}

//瀹炰緥鍖?
var Request = new CreateXHR();

function showsecond(x){
var URL = "__ROOT__/Lib/ORG/out.php?value=" + x;      
Request.open("GET", URL, true);
Request.onreadystatechange = Show_Second;
Request.send(null);

}
</script>	                     
</body>
</html>
